#pragma once

namespace Ideaoptics
{
	/// <summary>
	/// 光谱仪错误码
	/// </summary>
	enum class NetSpectrometerErrorCode
	{
		/// <summary>
		/// 无错误
		/// </summary>
		NoError = 0,
		/// <summary>
		/// 解析接收到的指令时,指令长度与小于最小长度
		/// </summary>
		ParserRecvInvalidTotalLength = 10,
		/// <summary>
		/// 解析接收到的指令时,起始符不匹配
		/// </summary>
		ParserRecvSofMismatch = 11,
		/// <summary>
		/// 解析接收到的指令时,数据长度不匹配
		/// </summary>
		ParserRecvInvalidDataLength = 12,
		/// <summary>
		/// 解析接收到的指令时出现其他异常
		/// </summary>
		ParserRecvUnexpectedError = 15,
		/// <summary>
		/// 解析需要发送的指令时出现异常
		/// </summary>
		ParserSendUnexpectedError = 16,

		/// <summary>
		/// 发送数据时,实际发送的长度与指定长度不匹配
		/// </summary>
		SocketSendDataLengthMismatch = 21,
		/// <summary>
		/// 发送数据时,Socket异常
		/// </summary>
		SocketSendSocketException = 22,
		/// <summary>
		/// 接收数据时,socket异常
		/// </summary>
		SocketRecvSocketException = 23,
		/// <summary>
		/// 接收数据时,接收到表示出错的状态码
		/// </summary>
		SocketRecvStateCodeError = 24,
		/// <summary>
		/// 多次尝试接收数据均失败
		/// </summary>
		SocketRecvAllAttemptsFailed = 25,

		/// <summary>
		/// 指令的数据格式错误(如各类系数)
		/// </summary>
		InstructionFormatError = 31,
		/// <summary>
		/// 接收到的光谱数据状态码与理论不符
		/// </summary>
		SpectrumStateCodeMismatch = 32,
		/// <summary>
		/// 接收到的光谱数据包数与理论不符
		/// </summary>
		SpectrumPackageNumberMismatch = 33,

		/// <summary>
		/// 触发开关设置未生效
		/// </summary>
		DeviceTrigSwitchFailed = 41,
		/// <summary>
		/// 收到的光谱数据帧数无法进行平均平滑计算
		/// </summary>
		DeviceInvalidAvgNum = 42,
		/// <summary>
		/// 非法输入
		/// </summary>
		DeviceInvalidInput = 43,
		/// <summary>
		/// 读缓存谱时出现丢帧
		/// </summary>
		DeviceFrameLost = 44,
		/// <summary>
		/// 当前设备不支持该功能
		/// </summary>
		DeviceFeatureNotSupported = 45,
		/// <summary>
		/// 光谱仪设置未生效
		/// </summary>
		DeviceSettingNotChanged = 46,
		/// <summary>
		/// 通道的索引/序列号超出范围
		/// </summary>
		DeviceIndexOutOfRange = -1,
		/// <summary>
		/// 光谱仪对象为空
		/// </summary>
		DeviceNull = -2,
		/// <summary>
		/// 未知错误
		/// </summary>
		UnknownError = -99
	};
}